package com.cn.fangshuo.controller;

import com.alibaba.fastjson2.JSONObject;
import com.cn.fangshuo.task.PushWuXiDaYunCarWashTask;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/cashwash")
public class CashWashController {

    @Autowired
    private PushWuXiDaYunCarWashTask pushWuXiDaYunCarWashTask;

    @GetMapping("/version")
    public String version(){
        return "目前是最新接口是 2025-10-09 16:40:00 上传的";
    }

    @GetMapping("/token")
    public String token(){
        return pushWuXiDaYunCarWashTask.getToken();
    }

    @PostMapping("/sign")
    public String sign(@RequestBody String json){
        return pushWuXiDaYunCarWashTask.getSign(JSONObject.parseObject(json), "CewinJgPFkoBIkQAszD0D6xQw5v8fKeZFM5FCrDV0qiyl7MJq8MjX9zYytwfc4vs");
    }

    @PostMapping("/install")
    public String install(){
        return pushWuXiDaYunCarWashTask.install();
    }
}
